<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
	<head>
		<meta name="decorator" content="default"/>
		<script type="text/javascript">
			$(document).ready(function() {
				
			});
			
			function page(n,s){
				$("#pageNo").val(n);
				$("#pageSize").val(s);
				$("#searchForm").submit();
	        	return false;
	        }
	        
	        //历史数据导出Excel文件
			function expExcelData(){
				var submit = function (v, h, f) {
				    if (v == 'ok'){
				        $("#searchForm").attr("action","${ctx}/ccsenhumidata/sensorHumiData/expExcelData");
						$("#searchForm").submit();
				    }
				    $("#searchForm").attr("action","${ctx}/ccsenhumidata/sensorHumiData");
				    return true; //close
				};
				
				$.jBox.confirm("确定导出历史数据吗？", "提示", submit);
			}
			
		</script>
		
		<style type="text/css">
			.active{
				color: #000000;
			}
			body{
				color: #000000;
				margin: 20px;
			}
			#exportBtn{
				width: 75px;
			}
			#officeContent{
				border: none;
			}
			#nowLevel{
				color: #000;
			}
		</style>
	</head>
	<body>
		<div>
			<form:form id="searchForm" modelAttribute="sensorHumiData" action="${ctx}/ccsenhumidata/sensorHumiData/detailList" method="post" class="breadcrumb form-search">
				<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
				<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
				<ul class="ul-form">
					<li >开始时间</li>
			 		<li style="margin-left: 10px; margin-top: -2px;"> <input type="text" id="startTime" name="startTime" style="width: 190px;" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${sensorHumiData.startTime}" /> </li>
					<li style="margin-left: 15px;">结束时间</li>
			 		<li style="margin-left: 10px; margin-top: -2px;"> <input type="text" id="endTime" name="endTime" style="width: 190px; margin-left: 5px;" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${sensorHumiData.endTime}" /> </li>  
					<li style="margin-top: -2px; margin-left: 25px;"> <button id="searchBtn"  class="btn btn-primary" onclick="getDetailData()">查询</button> </li>
					<!--  <li style="margin-top: -2px; margin-left: 15px;"> <input id="exportBtn"  class="btn btn-primary" value="导出EXCEL" onclick="expExcelData()"></input> </li>
					-->
					<li class="clearfix"></li>
				</ul>
			</form:form>
			<sys:message content="${message}"/>
			<table id="contentTable" class="table table-striped table-bordered table-condensed">
				<thead>
					<tr style="width:200px; height:30px;">
						<th>测量时间</th>
						<th>温度°C</th>
						<th>温度状态</th>
						<th>湿度%</th>
						<!-- <th>湿度状态</th> -->
						<th>数据状态</th>				
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${page.list}" var="sensorHumiData">
					<tr style="width:200px; height:30px;">
						<td>
							<fmt:formatDate value="${sensorHumiData.getTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
						</td>
						<td>
							${sensorHumiData.tempBcd}
						</td>
						<td>
							${sensorHumiData.tempIsnormal}
						</td>
						<td>
							${sensorHumiData.humiBcd}
						</td>
						<td>
							${sensorHumiData.deviceStatus}
						</td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			<div class="pagination">${page}</div>
		</div>
	</body>
</html>